<template>
  <div class="courts-select">
    <!-- 模糊搜索 -->
    <el-select
      v-model="filterValue"
      clearable
      filterable
      placeholder="请选项目阶段"
      @change="filterChange"
    >
      <el-option
        v-for="dict in phaseOptions"
        :key="dict.phaseId"
        :label="dict.phaseName"
        :value="dict.phaseId"
      />
    </el-select>
  </div>
</template>

<script>
import { getProjectPhase } from "@/api/ehr/phase";
export default {
  name: "",
  data() {
    return {
      phaseOptions: [],
      filterValue: "",
      loading: false,
      noMatchText: "暂无数据",
    };
  },
  props: {
    list: Array,
    projectId: {
      type: String,
      default: "",
    },
  },
  created() {
    this.getEnumData();
  },
  methods: {
    // 系统用户数据
    getEnumData() {
      this.loading = true; // 开始拿数据
      console.info("phaseEnm id "+this.projectId);
      getProjectPhase(this.projectId).then((response) => {
        this.phaseOptions = response.data;
        console.info("phaseOptions name "+this.phaseOptions);
      });
      this.loading = false;
    },
    // 查询选择
    filterChange(e) {
      this.$emit("getSelectedCourt", e);
      this.filterValue = e;
    },
  },
};
</script>

